/**
 * @description 供应商档案
 * @author caorui
 * @Date 2022-10-01 09:00
 */
// 供应商列表表头数据
const inventoryTableColumn = [
  {
    label: "所属公司",
    prop: "companyCount",
    tooltip: true,
    width: "80",
  },
  {
    label: "存货编码",
    prop: "invCode",
    tooltip: true,
  },
  {
    label: "助记码",
    prop: "zjm",
    tooltip: true,
  },
  {
    label: "存货名称",
    prop: "invName",
    tooltip: true,
  },
  {
    label: "计量单位",
    prop: "unitName",
    tooltip: true,
  },
  {
    label: "规格",
    prop: "specification",
    tooltip: true,
  },
  {
    label: "存货分类",
    prop: "invClassifyName",
    tooltip: true,
  },
  {
    label: "税率",
    prop: "taxRate",
    tooltip: true,
  },
  {
    label: "状态",
    prop: "stateName",
    tooltip: true,
  },
];
// 存货新增表单
const inventoryFormList = [
  {
    elCol: [
      {
        label: "存货编码",
        prop: "invCode",
        tag: "elInput",
      },
      {
        label: "助记码",
        prop: "zjm",
        tag: "elInput",
      },
    ],
  },
  {
    elCol: [
      {
        label: "存货名称",
        prop: "invName",
        tag: "elInput",
      },
      {
        label: "计量单位",
        prop: "unit",
        tag: "elSelect",
        options: [],
      },
    ],
  },
  {
    elCol: [
      {
        label: "规格",
        prop: "specification",
        tag: "elInput",
      },
      {
        label: "存货分类",
        prop: "invClassifyName",
        disabled: true,
        tag: "elInput",
      },
    ],
  },
  {
    elCol: [
      {
        label: "税率",
        prop: "taxRate",
        tag: "elInput",
      },
      {
        label: "状态",
        prop: "state",
        tag: "elRadio",
        options: [
          { label: "正常", value: 0 },
          { label: "停用", value: 1 },
        ],
      },
    ],
  },
  {
    elCol: [
      {
        label: "备注",
        prop: "remark",
        tag: "elInput",
        span: 24,
      },
    ],
  },
];

const showFormColumn = [
  {
    elCol: [
      {
        label: "存货编码",
        prop: "invCode",
      },
      {
        label: "助记码",
        prop: "zjm",
      },
      {
        label: "存货名称",
        prop: "invName",
      },
    ],
  },
  {
    elCol: [
      {
        label: "计量单位",
        prop: "unit",
      },
      {
        label: "规格",
        prop: "specification",
      },
      {
        label: "存货分类",
        prop: "invClassifyName",
      },
    ],
  },
  {
    elCol: [
      {
        label: "税率",
        prop: "taxRate",
      },
      {
        label: "状态",
        prop: "state",
      },
    ],
  },
  {
    elCol: [
      {
        label: "备注",
        prop: "remark",
        span: 24,
      },
    ],
  },
];
// 组织机构树表单
const treeFormData = [
  {
    elCol: [
      {
        label: "分类编码",
        prop: "code",
        tag: "elInput",
        span: 12,
      },
      {
        label: "分类名称",
        prop: "name",
        tag: "elInput",
        span: 12,
      },
    ],
  },
  {
    elCol: [
      {
        label: "顺序",
        prop: "sort",
        tag: "elInput",
        span: 12,
        rulesName: "integer",
        type: "number",
      },
      {
        label: "上级分类",
        prop: "codename",
        tag: "elInput",
        disabled: true,
        span: 12,
      },
    ],
  },
  {
    elCol: [
      {
        label: "备注",
        prop: "remark",
        tag: "elInput",
        span: 24,
      },
    ],
  },
];
const treeDialogRules = {
  code: [
    {
      required: true,
      message: "请输入分类编码",
      trigger: "blur",
    },
  ],
  name: [
    {
      required: true,
      message: "请输入分类名称",
      trigger: "blur",
    },
  ],
  sort: [
    {
      required: true,
      message: "请输入数字",
      trigger: "blur",
    },
    // { type: "number", message: "请输入有效的数字", trigger: "blur" },
  ],
};
const rules = {
  invCode: [
    {
      required: true,
      message: "请输入存货编码",
      trigger: "blur",
    },
  ],
  invName: [
    {
      required: true,
      message: "请输入存货名称",
      trigger: "blur",
    },
  ],
  unit: [
    {
      required: true,
      message: "请选择计量单位",
      trigger: "blur",
    },
  ],
  state: [
    {
      required: true,
      message: "请选择启用状态",
      trigger: "blur",
    },
  ],
};
export default {
  inventoryTableColumn,
  inventoryFormList,
  showFormColumn,
  treeFormData,
  treeDialogRules,
  rules,
};
